It is often important to identify the source of a request, such as a query, sent to a database management system (DBMS). Such information has many uses. For example, source information enables accounting to determine the share of a DBMS's resources that are consumed by a particular source. That information may be used for a number of purposes: (1) to charge back to the source a portion of the DBMS costs; (2) to identify, in a long-term-historical sense, the amount of work and the number of requests that come from each source so that performance tuning can be better focused to the largest, or otherwise most important, consumers as well as providing valuable insight into capacity planning as different workloads grow at different rates and, as a consequence, have different impacts on system sizing; (3) to identify, in real-time or recent historical terms, the precise source of a request so that if the request is determined to be problematic, it can be resolved or at least better understood by the database administrator (i.e., to abort or not to abort, or, if the request has already been completed, to relate resource usage metrics, SQL text, etc. of a particular query to its original source)